//
//  AKClient.h
//  AKPZ
//
//  Created by Lexi on 16-3-14.
//  Copyright (c) 2016年 aikangpeizhen. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "UserInfo.h"

typedef void(^LoginCompletionBlock)(UserInfo *userInfo);

@interface AKClient : NSObject

@property (copy, nonatomic) LoginCompletionBlock loginDoneBlock;
@property (strong, nonatomic) UserInfo *loginInfo;  //登录用户信息
@property (assign, nonatomic) BOOL logon;  //登录标识
@property (strong, nonatomic) NSMutableArray *provinceArray;    //省级地区数据(每次客户端生命周期查询一次,保存在内存中)
@property (strong, nonatomic) NSMutableArray *industryArray;    //行业大类(每次客户端生命周期查询一次,保存在内存中)

+ (id)sharedInstance;

- (void)autoLogin;  //1.在每一次Launch的时候自动登录 2.在每一次请求收到'27'错误码的时候自动登录
- (void)autoLogin:(void(^)(UserInfo *userInfo))block;   //需要处理block的自动登录

- (void)handleLoginDone:(NSDictionary *)data;    //登录成功以后, 处理解析和逻辑
- (void)handleTenantDone:(NSDictionary *)data;   //登录成功以后, 处理商户信息
- (void)handleServiceInfoDone:(NSDictionary *)data; //首页, 登录以后获取商户信息处理
- (void)handleLogoutDone;   //退出登录逻辑
- (void)handleProvinceArray:(NSMutableArray *)data;
- (void)handleIndustry:(NSMutableArray *)data;

- (void)clearKeychain;

@end
